<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>讨论</title>
		<load href="__JS__/menu.js" />
		<load href="__JS__/leftmenubar.js" />
		<load href="__CSS__/header.css" />
		<load href="__CSS__/footer.css" />
		<load href= "__JS__/jshelper.js" />
		<link rel="stylesheet" href="__JS__/kindeditor/themes/default/default.css" />
		<link rel="stylesheet" href="__JS__/kindeditor/plugins/code/prettify.css" />
		<script charset="utf-8" src="__JS__/kindeditor/kindeditor.js"></script>
		<script charset="utf-8" src="__JS__/kindeditor/lang/zh_CN.js"></script>
		<script charset="utf-8" src="__JS__/kindeditor/plugins/code/prettify.js"></script> 
		<script>
		KindEditor.ready(function(K) {
			var editor1 = K.create('textarea[name="text"]', {
				cssPath : '__JS__/kindeditor/plugins/code/prettify.css',
				uploadJson : '__JS__/kindeditor/php/upload_json.php?no={$no}',
				fileManagerJson : '__JS__/kindeditor/php/file_manager_json.php?no={$no}',
				allowFileManager : true,
				afterCreate : function() {
					var self = this;
					K.ctrl(document, 13, function() {
						self.sync();
						K('form[name=response]')[0].submit();
					});
					K.ctrl(self.edit.doc, 13, function() {
						self.sync();
						K('form[name=response]')[0].submit();
					});
				}
			});
			prettyPrint();
		});
	</script>
	
	<script>
	function responsedelete(id,discussid){
			if (confirm("你确定要删除吗")==true) 
				postwith('__URL__/responsedelete',{id:id,discussid:discussid});
			}
	</script>
	<load href="__JS__/jQuery/jquery.js" />
	<load href="__JS__/jQuery/jquery.form.js" />
	<script type="text/JavaScript">
		$(function(){
			$('#form1').ajaxForm({
				//beforeSubmit:  function(){alert("before");},  // pre-submit callback
				success:       complete,  // post-submit callback
				error:function(){alert("error");},
				dataType: 'json'
		    }); 
		    function complete(data){
				if (data.status==1)
				{
					window.location=window.location.href;
		        }else{
					$('#result').html(data.info).show();
		        }
		    }
		});
	</script>
	<load href="__JS__/jQuery/jquery.js" />
      	<load href="__JS__/jQuery/jquery.form.js" />
	<script type="text/JavaScript">
       $(function(){
           $('#form1').ajaxForm({
               //beforeSubmit:  function(){alert("before");},  // pre-submit callback
               success:       complete,  // post-submit callback
               error:function(){alert("error");},
               dataType: 'json'
           });
           
           function complete(data){
               if (data.status==1)
               {
               	window.location=window.location.href;
               }else{
                   $('#result').html(data.info).show();
               }
           }
       });
	</script>
	<script type="text/javascript">
		function responserequest(){
			alert("功能未实现");
			KE.html('tbContent','dasda');
		}
	</script>
</head>
<body>
	<layout name="Auth:header" />
	<div  class="nowposition">
	当前位置：
	<a href='__APP__/index/index'  class="nowpositionhref">主页</a>>
	<a href='__URL__/index'  class="nowpositionhref">课程展示</a>>
	<a href='__URL__/course/id/{$courseid}'  class="nowpositionhref">{$coursename}</a>>
	<a href='__URL__/discuss/id/{$courseid}'  class="nowpositionhref">讨论区</a>>
	<a href=""  class="nowpositionhref">浏览帖子</a>
	</div>
	<layout name="Auth:Courseleftmenu" />
	<div class="discusstopic">
		<table cellspacing="0px" cellpadding="0px" width="100%" style="font-size:16px;">
			<tr bgcolor="#CCCCCC" height="30px;">
				<td></td>
				<td  style="font-weight:bolder; font-size:18px;">{$vo.name}</td>
			</tr>
		</table>
	
			<table width="90%" cellpadding="0px" cellspacing="0px">
				<tr style="width:100%">
					<td></td>
					<td align="right" style="font-size:12px;">1楼</td>
				</tr>
				<tr height="150px">
					<td valign="top" style="font-size:18px; width:20%; font-weight:bolder" ><!--作者-->
						{$vo.nname}:
					</td>
					<td valign="top"><!--内容-->
						{$vo.text}
					</td>
				</tr>
				
		</table>

	<hr/>
	<volist name='list' id='vo1'>
	
				<table width="90%" cellpadding="0px" cellspacing="0px">
						<tr>
							<td></td>
							<td align="right" style="font-size:13px; height:20px;">{$vo1.count}楼 </td>
						</tr>
						
						<tr>
							<td style="font-weight:bold;"  valign="top" height="150px" ><!--作者-->
								{$vo1.nname}:
							</td>
							<td valign="top" ><!--内容-->
								{$vo1.text}
							</td>
						</tr>
						<tr>
							<td></td>
							<td align="right" style="font-size:13px;">
								回复时间：{$vo1.time} 
								<if condition='$a eq 0'>
									<else/>
										<a href="#" name="delete_discuss" onClick="responsedelete({$vo1.id},{$vo1.discussid})">删除</a>
								</if>
									<a href="#" onClick="responserequest()">回复</a>
									
							</td>
						</tr>		
				</table>
					<hr/>
					
		</volist>
		<div class="green-black" style="position:relative; top:17px;" align="right">{$page}</div>
		</div>
		<div class="responsediscuss">
		<form id='form1' method="post" name="response" action="__URL__/responseadd" >
			<input type='hidden' name='discussid' value={$vo.id}>
			发表回复<div id='result' align="left"style="color:red; font-size:12px;"></div>
            <br>
				<textarea name="text" id="tbContent" style="width:850px;hight:2000px;"></textarea>
			<br>
			<div align="right" style="width:85%">
				<input name="submit" type="submit"  value="发表 (ctrl+enter)" style="width:140px; height:30px; font-size:12px" >
			</div>
		</form>
		</div>
			
	
</body>
</html>